from flask import Blueprint, request
from ..controllers.payment import (
    create_payment,
    get_payments,
    get_payment,
    update_payment,
    delete_payment
)

# 创建缴费蓝图
payment_bp = Blueprint('payment', __name__)

# 路由定义 - 使用POST方法，暂时不添加JWT认证
@payment_bp.route('/payments/add', methods=['POST'])
def route_create_payment():
    return create_payment()

@payment_bp.route('/payments/list', methods=['GET'])
def route_get_payments():
    data = request.args.to_dict() or {}
    return get_payments(data)

@payment_bp.route('/payments/payment', methods=['GET'])
def route_get_payment():
    data = request.args.to_dict() or {}
    return get_payment(data)

@payment_bp.route('/payments/update', methods=['POST'])
def route_update_payment():
    return update_payment()

@payment_bp.route('/payments/delete', methods=['POST'])
def route_delete_payment():
    return delete_payment()